/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package deitel.polimorfismo;

/**
 *
 * @author Kelly Ruiz
 */
public class EmpleadoAsalariado extends Empleado{
    
    private double salario;
    
    public EmpleadoAsalariado(String nombre, String apdo, String seguro, double salary){
        
        super(nombre, apdo, seguro);
        setSalary(salary);
        
    }

    @Override
    public double obtenerMontoPago() {
//        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        return getSalary();
    }
    
    public void setSalary(double salary){
        
        if (salary > 0){
            salario = salary;
        }else{
            salario = 0.0;
        }
        
    }
    
    public double getSalary(){
        
        return salario;
    }
    
    
}
